using System;
using BaseAmd.Mmt;

namespace SiemensAmd.Mmt
{
	public class MmtToolEntity : BaseMmtToolEntity
	{
		[MmtDataElem(MmtNodeType.TcTp, "MAG_PLACE", "刀具位置（读生效）", Ignore = true)]
		public override int MagPlace { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "TNO", "刀具号")]
		public int TNo { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "TC_TP1", "姊妹刀号")]
		public int DuploNo { get; set; } = 1;


		[MmtDataElem(MmtNodeType.TcTp, "TC_TP2", "刀具标识符")]
		public override string ToolIdentify { get; set; } = "";


		[MmtDataElem(MmtNodeType.TcTp, "TC_TP3", "左侧尺寸")]
		public override double LeftSize { get; set; } = 1.0;


		[MmtDataElem(MmtNodeType.TcTp, "TC_TP4", "右侧尺寸")]
		public override double RightSize { get; set; } = 1.0;


		[MmtDataElem(MmtNodeType.TcTp, "TC_TP5", "上方尺寸")]
		public override double TopSize { get; set; } = 1.0;


		[MmtDataElem(MmtNodeType.TcTp, "TC_TP6", "下方尺寸")]
		public override double BottomSize { get; set; } = 1.0;


		[MmtDataElem(MmtNodeType.TcTp, "TC_TP7", "刀库类型")]
		public override int MagType { get; set; } = 1;


		[MmtDataElem(MmtNodeType.TcTp, "TC_TP8", "多刀状态")]
		public int MutilToolState { get; set; }

		public string MutilToolStateMsg => Enum.ToObject(typeof(SieToolStateEnum), this.MutilToolState)?.ToString();

		[MmtDataElem(MmtNodeType.TcTp, "TC_TP9", "刀具监视方法")]
		public override int ToolMonitor { get; set; }

		public string ToolMonitorMsg => this.ToolMonitor switch
		{
			0 => "没有刀具监控", 
			1 => "寿命监控", 
			2 => "工件数量监控", 
			4 => "通过磨损限值监控刀沿磨损参数", 
			8 => "通过磨损限值监控总补偿参数", 
			_ => this.ToolMonitor.ToString(), 
		};

		[MmtDataElem(MmtNodeType.TcTp, "TC_TP10", "备件更换策略")]
		public int SprStrategy { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "TC_TP11", "刀具信息")]
		public int ToolInfo { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "A_TOOLMN", "刀具当前所在的刀库号", Ignore = true)]
		public int AToolmn { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "A_TOOLMLN", "当前刀具所处的位置", Ignore = true)]
		public int AToolmln { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "P_TOOLND", "刀沿数量", Ignore = true)]
		public int PToolnd { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "A_MYMN", "刀具原来所处刀库", Ignore = true)]
		public int AMymn { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "A_MYMLN", "刀具原来所处刀库位置", Ignore = true)]
		public int AMymln { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "TC_TP_PROTA", "未知", Ignore = true)]
		public int TcTpProta { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "TC_TP_MAX_VELO", "当值〉0 时，为最大刀具转速。如果没有设定转速上限（=0），则没有监控", Ignore = true)]
		public int TcTpMaxVelo { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "TC_TP_MAX_ACC", "当值〉0 时，为最大刀具角度加速度。如果没有设定加速度上限（=0），则没有监控。", Ignore = true)]
		public int TcTpMaxAcc { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "A_TOOLMTN", "待定义", Ignore = true)]
		public int AToolmtn { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "A_TOOLMTLN", "待定义", Ignore = true)]
		public int AToolmtln { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "A_MYMTN", "待定义", Ignore = true)]
		public int AMymtn { get; set; }

		[MmtDataElem(MmtNodeType.TcTp, "A_MYMTLN", "待定义", Ignore = true)]
		public int AMymtln { get; set; }

		[MmtDataElem(MmtNodeType.TcTpg, "TC_TPG1", "监控数据和功能“恒定砂轮圆周速度”（SUG）所指的主轴编号", Ignore = true)]
		public int TC_TPG1 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpg, "TC_TPG2", "链接规则，该参数是逐位定义的", Ignore = true)]
		public int TC_TPG2 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpg, "TC_TPG3", "最小砂轮直径", Ignore = true)]
		public int TC_TPG3 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpg, "TC_TPG4", "最小砂轮宽度", Ignore = true)]
		public int TC_TPG4 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpg, "TC_TPG5", "当前砂轮宽度", Ignore = true)]
		public int TC_TPG5 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpg, "TC_TPG6", "最大砂轮转速", Ignore = true)]
		public int TC_TPG6 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpg, "TC_TPG7", "最大砂轮圆周速度", Ignore = true)]
		public int TC_TPG7 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpg, "TC_TPG8", "当前平面中倾斜砂轮的倾斜角", Ignore = true)]
		public int TC_TPG8 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpg, "TC_TPG9", "功能“恒定砂轮圆周速度", Ignore = true)]
		public int TC_TPG9 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpc, "TC_TPC1", "刀具相关用户数据1", Ignore = true)]
		public int TC_TPC1 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpc, "TC_TPC2", "刀具相关用户数据2", Ignore = true)]
		public int TC_TPC2 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpc, "TC_TPC3", "刀具相关用户数据3", IsOnlyIgnoreInsert = true)]
		public int TC_TPC3 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpc, "TC_TPC4", "刀具相关用户数据4", IsOnlyIgnoreInsert = true)]
		public int TC_TPC4 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpc, "TC_TPC5", "刀具相关用户数据5", IsOnlyIgnoreInsert = true)]
		public int TC_TPC5 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpc, "TC_TPC6", "刀具相关用户数据6", IsOnlyIgnoreInsert = true)]
		public int TC_TPC6 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpc, "TC_TPC7", "刀具相关用户数据7", IsOnlyIgnoreInsert = true)]
		public int TC_TPC7 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpc, "TC_TPC8", "刀具相关用户数据8", IsOnlyIgnoreInsert = true)]
		public int TC_TPC8 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpc, "TC_TPC9", "刀具相关用户数据9", IsOnlyIgnoreInsert = true)]
		public int TC_TPC9 { get; set; }

		[MmtDataElem(MmtNodeType.TcTpc, "TC_TPC10", "刀具相关用户数据10", IsOnlyIgnoreInsert = true)]
		public int TC_TPC10 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP1", "刀具类型")]
		public override int ToolType { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP2", "刀刃位置")]
		public int EdgeLoc { get; set; } = 1;


		[MmtDataElem(MmtNodeType.TcDp, "TC_DP3", "几何长度1")]
		public override double Len1 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP4", "几何长度2")]
		public override double Len2 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP5", "几何长度3")]
		public override double Len3 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP6", "几何半径")]
		public override double Radius { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP7", "几何倒角半径")]
		public double ChamferRadius { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP8", "几何长度4")]
		public override double Len4 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP9", "几何长度5")]
		public override double Len5 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP10", "几何角度1")]
		public override double Angle1 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP11", "锥形铣刀的几何角度2")]
		public double MillCutterAngle2 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP12", "磨损长度1")]
		public override double WearLen1 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP13", "磨损长度2")]
		public override double WearLen2 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP14", "磨损长度3")]
		public override double WearLen3 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP15", "磨损半径")]
		public override double WearRadius { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP16", "磨损槽宽度/圆弧半径")]
		public double WearSlotWidth { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP17", "磨损长度")]
		public override double WearLen { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP18", "磨损长度5")]
		public override double WearLen5 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP19", "磨损角度1")]
		public override double WearAngle1 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP20", "锥形铣刀的磨损角度2")]
		public double ConeMillCutterAngle2 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP21", "适配器长度1")]
		public double AdapterLen1 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP22", "适配器长度2")]
		public double AdapterLen2 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP23", "适配器长度3")]
		public double AdapterLen3 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP24", "间隙角度")]
		public double SpaceAngle { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DP25", "切割速率,用于手动转动", Ignore = true)]
		public int TC_DP25 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DPH", "H parameter (Y / extraCuttEdgeParams)", Ignore = true)]
		public int TC_DPH { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DPNT", "未知", Ignore = true)]
		public int TC_DPNT { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DPV", "刀具切削刃方向", Ignore = true)]
		public int TC_DPV { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DPV3", "L1 component of the tool cutting edge orientation", Ignore = true)]
		public int TC_DPV3 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DPV4", "Tool cutting edge orientation", Ignore = true)]
		public int TC_DPV4 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DPV5", "L3 component of the tool cutting edge orientation", Ignore = true)]
		public int TC_DPV5 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DPVN3", "未知", Ignore = true)]
		public int TC_DPVN3 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DPVN4", "未知", Ignore = true)]
		public int TC_DPVN4 { get; set; }

		[MmtDataElem(MmtNodeType.TcDp, "TC_DPVN5", "未知", Ignore = true)]
		public int TC_DPVN5 { get; set; }

		[MmtDataElem(MmtNodeType.TcMop, "TC_MOP1", "刀具寿命时间监控的预警限值")]
		public override double LifLimit { get; set; }

		[MmtDataElem(MmtNodeType.TcMop, "TC_MOP2", "刀具寿命时间监控的剩余值")]
		public override double LifeQualityRemain { get; set; }

		[MmtDataElem(MmtNodeType.TcMop, "TC_MOP3", "刀具寿命工件数量预警限值")]
		public override int WorkCountLimit { get; set; }

		[MmtDataElem(MmtNodeType.TcMop, "TC_MOP4", "刀具寿命工件计数监控的剩余值")]
		public override int WorkCountRemain { get; set; }

		[MmtDataElem(MmtNodeType.TcMop, "TC_MOP5", "刀沿磨损预警限值")]
		public double EdgeWearLimit { get; set; }

		[MmtDataElem(MmtNodeType.TcMop, "TC_MOP6", "刀沿磨损实际值")]
		public double EdgeWearActual { get; set; }

		[MmtDataElem(MmtNodeType.TcMop, "TC_MOP11", "刀具寿命时间监控的设定值")]
		public override double LifeQualitySet { get; set; }

		[MmtDataElem(MmtNodeType.TcMop, "TC_MOP13", "刀具寿命工件数量监控的设定值")]
		public override int WorkCountSet { get; set; }

		[MmtDataElem(MmtNodeType.TcMop, "TC_MOP15", "刀沿磨损监控的设定值")]
		public override double EdgeWearSet { get; set; }

		[MmtDataElem(MmtNodeType.TcDpc, "TC_DPC1", "刀刃用户数据1", Ignore = true)]
		public double TC_DPC1 { get; set; }

		[MmtDataElem(MmtNodeType.TcDpc, "TC_DPC2", "刀刃用户数据2", Ignore = true)]
		public double TC_DPC2 { get; set; }

		[MmtDataElem(MmtNodeType.TcMopc, "TC_MOPC1", "刀沿监控用户数据1", Ignore = true)]
		public double TC_MOPC1 { get; set; }

		[MmtDataElem(MmtNodeType.TcMopc, "TC_MOPC2", "刀沿监控用户数据2", Ignore = true)]
		public double TC_MOPC2 { get; set; }

		[MmtDataElem(MmtNodeType.Tdi, "TDI_OBJECT_ID", "Catalog ID", Ignore = true)]
		public string TDI_OBJECT_ID { get; set; } = "";


		[MmtDataElem(MmtNodeType.Tdi, "TDI_EXTERN_ID", "刀具标识")]
		public virtual string TDI_EXTERN_ID { get; set; } = "";


		[MmtDataElem(MmtNodeType.Tdi, "TDI_TOOLID_DESCRIPTION", "刀具说明")]
		public override string ToolsDescription { get; set; } = "";


		[MmtDataElem(MmtNodeType.Tdi, "TDI_TOOL_COMMENT", "刀具注释")]
		public override string ToolsComment { get; set; } = "";


		[MmtDataElem(MmtNodeType.Tdi, "TDI_PRESETTING_TIME", "未知", Ignore = true)]
		public string TDI_PRESETTING_TIME { get; set; } = "";


		[MmtDataElem(MmtNodeType.Tdi, "TDI_EXTTOOLSTATE", "未知", Ignore = true)]
		public int TDI_EXTTOOLSTATE { get; set; }

		[MmtDataElem(MmtNodeType.Tdi, "TDI_ASSIGNED_CONTAINER", "未知", Ignore = true)]
		public string TDI_ASSIGNED_CONTAINER { get; set; } = "";


		[MmtDataElem(MmtNodeType.Tdi, "TDI_LAST_ACCESS_PROG", "未知", Ignore = true)]
		public string TDI_LAST_ACCESS_PROG { get; set; } = "";


		[MmtDataElem(MmtNodeType.Tdi, "TDI_LAST_ACCESS_TIME", "未知", Ignore = true)]
		public string TDI_LAST_ACCESS_TIME { get; set; } = "";


		[MmtDataElem(MmtNodeType.Tdi, "TDI_LAST_ACCESS_EDGE", "未知", Ignore = true)]
		public string TDI_LAST_ACCESS_EDGE { get; set; } = "";


		public UserDataEntity UserDataEntity { get; set; }
	}
}
